1. Field of the Invention
This invention relates to caching algorithms, and more particularly to apparatus and methods for increasing the efficiency of a cache.
2. Background of the Invention
In the field of computing, cache algorithms (also referred to as replacement algorithms or replacement policies) are algorithms that a computer program or hardware uses to manage information stored in its cache. When the cache is full, the computer uses the algorithm to determine which items to discard in order to make space for new items. The “hit rate” of the cache describes how often a searched-for item is actually found in the cache. The “latency” of the cache describes how long after requesting a desired item the cache can return the item (assuming a hit occurs). More efficient replacement policies generally keep better track of usage information in an effort to improve cache hit rates. Faster replacement strategies generally disregard usage information to reduce the amount of time required to update the information. In general, a replacement strategy is typically a compromise between hit rate and latency.
In some cases, storage controllers or other computing devices may control storage devices with I/O rates that differ significantly. For example, a storage controller may control both solid-state drives (SSDs) and hard-disk drives (HDDs). Because the I/O speed does not depend on the physical location of data within an SSD, the read performance of SSDs is typically far higher than the read performance of HDDs. Unfortunately, modern cache algorithms do not distinguish between data originating from faster storage devices and data originating from slower storage devices. This can cause data from faster storage devices to fill up the cache (since a host can drive I/O to a faster-responding storage device much faster) and leave little room for data from slower storage devices. This can also reduce the read-hit ratio for the slower storage device. This is an inefficient way to allocate space in the cache, since data from faster storage devices can be fetched much faster than data from slower storage devices.
In view of the foregoing, what are needed are apparatus and methods to more efficiently allocate cache to increase the hit rates of slower-responding storage devices. More specifically, apparatus and methods are needed to efficiently allocate space in a cache based on media I/O speed. Further needed are apparatus and methods to prevent data from faster-responding storage devices from dominating the cache to the detriment of slower-responding storage devices.